
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <asm/fpu/api.h>

static double num = 22.0, den = 7.0, mypi;

static int __init float_init(void)
{
    kernel_fpu_begin();
    mypi = num / den;
    pr_info("PI = %.4f = %.4f\n", mypi, num / den);
    kernel_fpu_end();

    return 0;		/* success */
}

static void __exit float_exit(void)
{
    kernel_fpu_begin();
    pr_info("mypi = %f\n", mypi);
    kernel_fpu_end();

    pr_info("removed\n");
}

module_init(float_init);
module_exit(float_exit);
MODULE_LICENSE("GPL");